<html>
<head><meta charset="utf-8"><title>out of tree MIR pass · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/out.20of.20tree.20MIR.20pass.html">out of tree MIR pass</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246678052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/out%20of%20tree%20MIR%20pass/near/246678052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Natalie Popescu <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/out.20of.20tree.20MIR.20pass.html#246678052">(Jul 21 2021 at 04:19)</a>:</h4>
<p>does anyone have pointers for how to implement an out of tree MIR pass? i would like to do a simple transformation on the MIR (replace one function call with another) but haven't found a way of feeding this back into the compiler so i can benchmark the transformed binary</p>



<a name="246682876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/out%20of%20tree%20MIR%20pass/near/246682876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/out.20of.20tree.20MIR.20pass.html#246682876">(Jul 21 2021 at 06:08)</a>:</h4>
<p>You can override the optimized_mir query and call DEFAULT_PROVIDERS.optimized_mir from inside the override before running your own mir pass on the resulting mir.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>